/**
 * Copyright (c) 2001-2008, TIBCO Software Inc.
 * Use, modification, and distribution subject to terms of license.
 */

/**
 * Interface for all ExtendPane component contained in ListContainer, such as CLSimpleSearch, CLAdvancedSearch and Film Strip.
 */
// if(demo.uxcore.IExtendable) delete demo.uxcore.IExtendable;
jsx3.lang.Class.defineInterface("demo.uxcore.IExtendable", null,
  function(EXTEND, extend) {
      
    /**
     * The default extendId is sub implementation class name, 
     * but if there are more than one same sub-classes under ExtendPane that should use this method to set a unified extendId.
     * @param strId {String} the string id to be setted
     */
    extend.setExtendId = function(strId) {
      this.jsxextendid = strId;
    };

    /**
     * Get id from extendpane object.
     * @return {String} the id of this extendpane object
     */
    extend.getExtendId = function() {
      return this.jsxextendid || this.getClass().getName();
    };

    /**
     * Utility function to get the parent ListContainer of this gui object.
     * @return {demo.uxcore.ListContainer} - the parent ListContainer of this gui object
     */
    extend.getListContainer = function() {
      return this.getAncestorOfType("demo.uxcore.ListContainer");
    };

    /**
     * Utility function to get the parent ExtendPane of this gui object.
     * @return {demo.uxcore.ExtendPane} - the parent ExtendPane of this gui object
     */
    extend.getExtendPane = function() {
      return this.getAncestorOfType("demo.uxcore.ExtendPane");
    };

    /**
     * To be called whenever the this extended pane should be applied to the ExtendPane gui.
     */
    extend.doExecute = function() {
      this.onExecute(this.getListContainer());
    };

    /**
     * Used to notify this extended pane that a execute action was requested.
     */
    extend.onExecute = jsx3.lang.Method.newAbstract('listContainer');

    /**
     * Used to tell the extended pane to reset itself.  
     * Should be implemented by each extended pane to reset their own state.
     */
    extend.reset = jsx3.lang.Method.newAbstract();

});